home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1987-03-28 | 2.4 KB | 94 lines |
- 100 ' This program will help you choose PASSWORDS for logging on bulletin boards
- 110 ' This program was put together in about 5 minutes, so there may be a few
- 120 ' bugs in the character generating subroutines. However, for the most part,
- 130 ' you should be able to get passwords that are random enough to deter any
- 140 ' guessing work on the part of a hacker.
- 150 ' I always seem to have trouble getting a random number within a certain
- 160 ' range. Let's see, does it go INT(RND*30)+29 or INT(RND*29)+30???!!!???!!!
- 170 ' No matter! It seems to work well enough!
- 180 ' Written under the influence of too much modeming by J. Richard Dale
- 190 ' Co-sysop of the Penn Valley Community College Bulletin Board System of
- 200 ' Kansas City, Missouri. (816)932-7687, 8pm to 8am, 4pm Fridays to
- 210 ' 8am Mondays, 24 hours on holidays
- 220 '
- 230 '
- 240 '
- 250 ' If you use this program, please consider a contribution in the form of
- 260 ' an upload to the Penn Valley BBS. Or secondly to Johnson County BBS
- 270 ' (913)469-3831 or (931)469-3832, 24 hours
- 280 '
- 290 '
- 300 '
- 310 CLS:KEY OFF
- 320 INPUT "How many passwords do you want to generate? ",A:CLS:DIM PW$(A)
- 330 INPUT "How many characters do you want in the password? ",B:CLS
- 340 PRINT "Do you want:":PRINT
- 350 PRINT "1 - Letters only"
- 360 PRINT "2 - Numbers only"
- 370 PRINT "3 - Letters and numbers"
- 380 PRINT "4 - Letters and characters
- 390 PRINT "5 - Numbers and characters
- 400 PRINT "6 - Letters, Numbers and characters
- 410 PRINT:PRINT "Press a key corresponding to your choice"
- 420 A$=INKEY$:IF A$="" THEN 420
- 430 Z=VAL(A$):IF Z<1 OR Z>6 THEN 420
- 440 CLS:PRINT "Working.....please stand by"
- 450 FOR LOOP=1 TO A
- 460 FOR LOOPA=1 TO B
- 470 ON Z GOSUB 600,670,740,830,920,990
- 480 PW$(LOOP)=PW$(LOOP)+A$
- 490 NEXT:NEXT
- 500 FOR LOOP=1 TO A
- 510 PRINT PW$(LOOP)
- 520 NEXT
- 530 PRINT "That completes the list of passwords."
- 540 END
- 550 '
- 560 '
- 570 '
- 580 '
- 590 ' To pick letters only
- 600 RANDOMIZE TIMER
- 610 A$=CHR$(INT(RND*25)+65)
- 620 RETURN
- 630 '
- 640 '
- 650 '
- 660 ' To pick letters only
- 670 RANDOMIZE TIMER
- 680 A$=CHR$(INT(RND*9)+48)
- 690 RETURN
- 700 '
- 710 '
- 720 '
- 730 ' To pick letters and numbers
- 740 RANDOMIZE TIMER
- 750 Q=(INT(RND*42)+48)
- 760 IF Q>=58 AND Q<=64 THEN 750
- 770 A$=CHR$(Q)
- 780 RETURN
- 790 '
- 800 '
- 810 '
- 820 ' To pick letters and characters
- 830 RANDOMIZE TIMER
- 840 Q=(INT(RND*62)+33)
- 850 IF Q>=48 AND Q<=57 THEN 840
- 860 A$=CHR$(Q)
- 870 RETURN
- 880 '
- 890 '
- 900 '
- 910 ' To pick numbers and characters
- 920 RANDOMIZE TIMER
- 930 A$=CHR$(INT(RND*31)+33)
- 940 RETURN
- 950 '
- 960 '
- 970 '
- 980 ' To pick letters, numbers and characters
- 990 RANDOMIZE TIMER
- 1000 Q=(INT(RND*62)+33)
- 1010 A$=CHR$(Q)
- 1020 RETURN
-